public class Solution649 {
    public String predictPartyVictory(String senate) {
        int xr=0,xd=0;
        while (true){
            StringBuilder stringBuilder=new StringBuilder();
            int flag1=0,flag2=0;
            for (char c : senate.toCharArray()) {
                if (c=='D'){
                    if (xd==0) {
                        stringBuilder.append('D');
                        xr++;
                        flag1=1;
                    }else{
                        xd--;
                    }
                }else{
                    if (xr==0){
                        stringBuilder.append('R');
                        xd++;
                        flag2=1;
                    }else{
                        xr--;
                    }
                }
            }
            senate=stringBuilder.toString();
            if (flag1+flag2!=2){
                break;
            }
        }
        return senate.charAt(0)=='R'?"Radiant":"Dire";
    }

    public static void main(String[] args) {
        System.out.println(new Solution649().predictPartyVictory("RDD"));
    }
}
